package com.itheima.mall.controller;

import com.itheima.mall.mapper.PrefrenceAreaMapper;
import com.itheima.mall.pojo.PrefrenceArea;
import com.itheima.mall.service.CmsPrefrenceAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/prefrenceArea")
public class CmsPrefrenceAreaController {
    @Autowired
    private CmsPrefrenceAreaService cmsPrefrenceAreaService;

    @GetMapping("/listAll")
    public ResponseEntity listAllPrefrenceArea(){

       List<PrefrenceArea> list = cmsPrefrenceAreaService.listAllPrefrenceArea();
        return ResponseEntity.ok(list);
    }


}
